package cn.school.attendance.dormitory.entity;

import cn.hutool.core.date.DatePattern;
import cn.school.common.utils.SysUserUtils;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author: lx
 * @date: 2023/9/5 9:39
 * @description:
 */
@Data
@TableName("t_attendance_rules")
public class AttendanceRules implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId
    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "考勤时间段类型（0 - 早自习 1 - 上午 2 - 中午 3 - 晚上 4 - 宿舍考勤）见数据字典")
    private String timeSlot;

    @ApiModelProperty(value = "考勤开始时间")
    private String attendanceStartTime;

    @ApiModelProperty(value = "考勤结束时间")
    private String attendanceEndTime;

    /**
     * 创建时间
     */
    @ExcelIgnore
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GMT+8")
    @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private Date createTime;

    /**
     * 修改时间
     */
    @ExcelIgnore
    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GMT+8")
    @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private Date modifyTime;

    private String createBy;

    private String modifyBy;

    @TableField(exist = false)
    private int pageNum;
    @TableField(exist = false)
    private int pageSize;

    @TableField(exist = false)
    private String timeSlotLabel;

    /**
     * 默认租户为当前登录人的租户
     */
    private String tenantId = SysUserUtils.getSysUser().getTenantId();
}
